
function get_c1_data() {
	$.ajax({
		url: "/c1",
		success: function(data) {
			$(".num h1").eq(0).text(data.data);
			$(".num h1").eq(2).text(data.data1);
			$(".num h1").eq(1).text(data.data2);
		},
		error: function(xhr, type, errorThrown) {

		}
	})
}

function get_c2_data() {
    $.ajax({
        url:"/c2",
        success: function(data) {
			ec_center_option.series[0].data=data.data;
            ec_center.setOption(ec_center_option)
		},
		error: function(xhr, type, errorThrown) {

		}
    })
}

function get_l1_data() {
    $.ajax({
        url:"/l1",
        success: function(data) {
			ec_left1_option.yAxis.data=data.data;
            ec_left1_option.series[0].data=data.value;
            ec_left1.setOption(ec_left1_option);
		},
		error: function(xhr, type, errorThrown) {

		}
    })
}

function get_l2_data() {
    $.ajax({
        url:"/l2",
        success: function(data) {
            ec_left2_Option.series[1].data=[data]
            ec_left2.setOption(ec_left2_Option)
		},
		error: function(xhr, type, errorThrown) {

		}
    })
}

function get_r1_data() {
    $.ajax({
        url: "/r1",
        success: function (data) {
            ec_right1_option.yAxis.data=data.data;
            ec_right1_option.series[0].data=data.value;
            ec_right1.setOption(ec_right1_option);
        }
    })
}

function get_r2_data() {
    $.ajax({
        url: "/r2",
        success: function (data) {
            ec_right2_option.series[0].data=data.data;
            ec_right2.setOption(ec_right2_option);
        }
    })
}


get_c1_data();
get_c2_data();
get_l1_data();
get_l2_data();
get_r1_data();
get_r2_data();


setInterval(get_c1_data,1000);
setInterval(get_c2_data,1000);
setInterval(get_l1_data,1000);
setInterval(get_l2_data,1000);
setInterval(get_r1_data,1000);
setInterval(get_r2_data,1000);
